const wx2my = require('../../../wx2my');
const Behavior = require('../../../Behavior');
var app = getApp();
Page({
  data: {
    none_list: !1,
    page: 1,
    goods_list: []
  },
  onLoad: function (t) {
    wx2my.setNavigationBarColor({
      frontColor: '#000000',
      backgroundColor: '#ffffff'
    });
    var a = this;
    a.setData({
      platform: wx2my.getStorageSync("platform")
    }), a.refresh(), a.reload();
  },
  refresh: function (t) {
    var a = this;
    a.setData({
      url: wx2my.getStorageSync("url")
    }), app.util.request({
      url: "entry/wxapp/getad",
      cachetime: "0",
      data: {
        type: 2
      },
      success: function (t) {
        console.log(t), 0 < t.data.length && a.setData({
          nav: t.data
        });
      }
    }), app.util.request({
      url: "entry/wxapp/JfTypeList",
      cachetime: "0",
      success: function (t) {
        console.log(t), a.setData({
          type_list: t.data
        });
      }
    });
  },
  reload: function (t) {
    var a = this,
        e = a.data.page,
        o = a.data.goods_list;
    app.util.request({
      url: "entry/wxapp/JfGoodsList",
      cachetime: "0",
      data: {
        page: e
      },
      success: function (t) {
        console.log(t), 0 < t.data.length ? (a.setData({
          page: e + 1
        }), o = o.concat(t.data), a.setData({
          goods_list: o
        })) : a.setData({
          none_list: !0
        });
      }
    });
  },
  jifeninfo: function (t) {
    wx2my.navigateTo({
      url: "jifeninfo?id=" + t.currentTarget.dataset.id
    });
  },
  index: function (t) {
    wx2my.redirectTo({
      url: "../index/index"
    });
  },
  record: function (t) {
    wx2my.navigateTo({
      url: "scoredetails"
    });
  },
  exchange: function (t) {
    wx2my.navigateTo({
      url: "exchange"
    });
  },
  type_list: function (t) {
    var a = t.currentTarget.dataset.id;
    wx2my.navigateTo({
      url: "score_classifation?id=" + a
    });
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {
    var t = this;
    t.setData({
      page: 1,
      goods_list: []
    }), t.refresh(), t.reload(), wx2my.stopPullDownRefresh();
  },
  onReachBottom: function () {
    this.reload();
  },
  onShareAppMessage: function () {}
});